
package com.sw.c.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;



@Data
@NoArgsConstructor
public class PageResult<T> {

    private Long total;

    private Long pages;

    private List<T> list;

    public PageResult(Long total, Long pages, List<T> list) {
        super();
        this.total = total;
        this.pages = pages;
        this.list = list;
    }

    public PageResult(Page<T> page) {
        this.list = page.getRecords();
        this.total = page.getTotal();
        this.pages = page.getPages();
    }

}
